package com.dragon.web.commons.vo;

import java.util.HashMap;

import com.dragon.web.commons.constant.ErrorCode;

/**
 * @author ljs
 */
public class FintechResult {
	
	private String errorCode;
	private String message = "";
	private Object data;
	
	public static FintechResult getResult(String errorCode ,String message ,Object data){
		FintechResult fintechResult = new FintechResult();
		fintechResult.setData(data);
		fintechResult.setErrorCode(errorCode);
		fintechResult.setMessage(message);
		if(data == null) {data = new HashMap<String, Object>();}
		fintechResult.setData(data);
		return fintechResult;
	}
	
	public static FintechResult getSuccessResult(Object data){
		FintechResult fintechResult = new FintechResult();
		fintechResult.setData(data);
		fintechResult.setErrorCode("0");
		fintechResult.setMessage("调用成功");
		if(data == null) {data = new HashMap<String, Object>();}
		fintechResult.setData(data);
		return fintechResult;
	}
	public static FintechResult getFailResult(String errorCode ,String message){
		FintechResult fintechResult = new FintechResult();
		fintechResult.setErrorCode(errorCode);
		fintechResult.setMessage(message);
		fintechResult.setData(null);
		return fintechResult;
	}
	public static FintechResult getFailNullParam(String message){
		FintechResult fintechResult = new FintechResult();
		fintechResult.setErrorCode(ErrorCode.PARAM_NULL);
		fintechResult.setMessage(message);
		fintechResult.setData(null);
		return fintechResult;
	}


	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
}
